<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
		<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1">
		<link rel="stylesheet" type="text/css" href="css/style.css"/>
		<title>顶岗实习管理系统(学生版)</title>
	</head>
	<body>
		<div class="header_moible">
			顶岗实习管理系统(学生版)
		</div>
		<div class="rightinfo rightinfo_mobile">
    
    <div class="tools">
    <ul class="toolbar">
        <li class="click add"><span><img src="images/t01.png" /></span>添加</li>
        <li  onclick="history.go(-1)"><span><img src="images/fh.png" style="width: 20px;height: 20px;"/></span>返回</li>
        </ul>
        <form id="searchForm" class="form-search"
						action="weeknote/moible_myWeeknote_page_list.do" method="post">
						 <input type="hidden" name="pageNumber" value="1" />
					</form>
    </div>
       <table class="tablelist tablelist_mobile">
    	<thead>
    	<tr>
    	<th>姓名</th>
        <th>时间范围</th>
        <th >第几周</th>
		<th>指导教师</th>
       <th>是否批阅</th>
       	<th>操作</th>
      </tr>
        </thead>
        <tbody>
        <c:forEach items="${weeknoteList}" var="weeknote"  varStatus="status">
      <tr>
       <td>${weeknote.studentName}</td>
        <td>${weeknote.dateScope}</td>
        <td>${weeknote.weekNo}</td>
        <td>${weeknote.teacherName}</td>
        <td><c:if test="${weeknote.hasComment==0}">未批阅</c:if> <c:if test="${weeknote.hasComment==1}"> 已批阅</c:if> </td>
		<td><a onclick="check(${weeknote.id});">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
		<c:if test="${weeknote.hasComment==0}"><a onclick="edit(${weeknote.id});">编辑</a></c:if></td>
		</tr>
		</c:forEach>
        </tbody>
    </table>
   <div class="pagin">
    	<%@ include file="page.jsp"%>
    </div>
    </div>
    <script src="js/jquery-1.7.2.js"></script>
    <script src="layer/layer.js"></script>
	<script type="text/javascript">
    $('.tablelist tbody tr:odd').addClass('odd');
	$( "#btnSearch" ).on('click', function(e) {
		$("#searchForm").submit();
	});
	function GoToPage(toPage,totalPage) {
	    if(toPage<=0) return;
	    if(toPage>totalPage) return;
	    $("input[name='pageNumber']").val(toPage);
	    $("#searchForm").submit();
	};
	function  check(id) {
		layer.open({
		  type: 2,
		  closeBtn: 2,
		  title: '查看周记',
		  shadeClose: true,
		  shade: 0.6,
		  area: ['90%', '450px'],
		  content: 'weeknote/moible_weeknote_check.do?id='+id,
});
	}	
$(".add").click(
	function  () {
		layer.open({
		  type: 2,
		  closeBtn: 2,
		  title: '填写周记',
		  shadeClose: true,
		  shade: 0.6,
		  area: ['90%', '400px'],
		  content: 'weeknote/moible_weeknote_add.do',
		  end: function () {
	      location.reload();
 	 }
});
	}
	);
	
function closeAll() {
	layer.alert('添加成功!', {
		skin : 'layer-ext-moon'
	}, function() {
		layer.closeAll(); 
		 location.reload();
	}); 
}
function close() {
	layer.alert('编辑成功!', {
		skin : 'layer-ext-moon'
	}, function() {
		layer.closeAll(); 
		 location.reload();
	}); 
}
function  edit(id) {
	layer.open({
	type: 2,
	closeBtn: 2,
	title: '编辑周记',
	shadeClose: true,
	shade: 0.6,
	area: ['90%', '450px'],
	content: 'weeknote/moible_weeknote_edit.do?id='+id,
	end: function () {
    location.reload();
}
});
	}

	</script>
</body>

</html>
